def isPerfectNumber(n):
    s=0
    for i in range (1,n):
     if n%i==0:
        s=s+i
    if s==n :
       return True
    else:
       return False
       
n=eval(input("判断一个数是否为完数:"))
print(isPerfectNumber(n))